1. Field of the Invention
The present invention relates to a programmable controller having a fuzzy control function, which performs fuzzy control on an analog data input, the fuzzy control process thereof and a fuzzy control monitoring process.
2. Description of the Prior Art
Recently, in the control field, control systems to which fuzzy logic principles are applied have been the subject of intense research and development.
FIG. 11 is a diagram (a descriptive representation of a fuzzy-control machine tool) showing the configuration of a prior art fuzzy controller. See "Fuzzy Expert System Configuring Tool Having Real-Time Control Functions", pp. 60-63, Mitsubishi Electric Technical Information Vol. 63, No. 3. In FIG. 11, numeral 10 indicates a fuzzy controller, 20 a system to be controlled by the fuzzy controller, and 30 a setting/monitoring device electrically connected to the controller 10 for setting therein the fuzzy membership functions (hereinafter referred to as "membership functions") and fuzzy control application software, and for monitoring the control operation. The fuzzy controller 10 comprises a general-purpose, high-speed CPU, such as a digital signal processor (DPS), and is composed of an inference engine 11 for making inferences, an A/D converter 12 for converting input analog data into digital data, a D/A converter 13 for converting digital data into analog data and outputting the result, a memory 14 for storing a plurality of membership functions and fuzzy output functions as parameter values and for storing application programs as application software for fuzzy inferences, the setting/monitoring device 30, and a line controller 15 for connecting the fuzzy controller 10.
FIG. 12 shows an example of a fuzzy control application program stored in the memory 14 and executed in the inference engine 11. FIGS. 13a to c show examples of A/D-converted inputs and the conversion thereof into fuzzy grade numbers using a plurality of membership functions, as part of an inferencing process in accordance with the fuzzy control application program example shown in FIG. 12, and a defuzzed inference output, discussed hereafter. FIG. 14 is a flowchart of the fuzzy control process in accordance with the fuzzy control application program shown in FIG. 12.
Operation will now be described using FIG. 14 on the assumption that the fuzzy application program shown in FIG. 12 has been written to the memory 14 in FIG. 11. The inference engine 11 reads the said application program from the memory 14 one line at a time and executes it on a line-by-line basis. The contents of rule R1 on line one are as follows:
if A11 and A12 then B1
The "and" in rule R1 is a minimizing operation for selecting the smaller one of first fuzzy grade numbers A11 and A12. The operation result of the above conditional statement, A1, is also a fuzzy grade number. Hereinafter A11, A12, etc., are referred to as first fuzzy grade numbers and A1, etc., as second fuzzy grade numbers. The inference engine 11 will interpret the above rule R1 and first find the first fuzzy grade number A11.
To find the first fuzzy grade number A11, a fuzzy inference process is started at step 500 in the flowchart shown in FIG. 14. The inference engine 11 reads and interprets, at step, 501, the first rule Ri (i=1). At step 502, the inference engine inputs from the controlled object a value x1, via the A/D converter 12, converts the same into a first fuzzy grade number by means of membership function all corresponding to A11 shown in FIG. 13a, and finds A11.ident.a11(x1) =0.6. Then, to obtain the first fuzzy grade number A12, the inference engine 11 inputs a value x2 via the A/D converter 12, converts the same into a fuzzy grade number by means of membership function a12 corresponding to A12 shown in FIG. 13b, and finds A12.ident.a12(x2)=0.90. At step 503, the inference engine 11 then performs the following fuzzy operation on the obtained fuzzy grade numbers A11 and A12 and finds the second fuzzy grade number A1, i.e., obtains the second fuzzy grade number A1=0.60 from the following expression:
A11 and A12.ident.A1=0.60 and 0.90.ident.0.60
Then, at step 504, the inference engine 11 performs the following implication operation:
A1.circle.B1
for the above obtained value A1 (=0.60) using a fuzzy membership output function B1 (hereinafter referred to as a "fuzzy output function") which is different from the previously mentioned membership functions. The ".circle." in the above implication operation A1.circle.B1 contracts the fuzzy output function B1 at the same ratio as the value of the second fuzzy grade number A1. Since A1=0.60 in this case, the fuzzy set which is the result of the implication operation is a reduction of the whole fuzzy output function B1 at a ratio of 1 to 0.6. This operation result is shown by a hatched area in FIG. 13C.
The inference engine 11 then judges, at step 505, whether processing of all rules R1 to Rn is complete. If so, the processing will progress to step 507. Since the processing is not yet complete in this example, the inference engine 11 reads the next rule, i.e., the rule R2 on line two, from the memory 14 and interprets its contents at step 506, and returns to step 502. The contents of line two read:
if A21 and A22 then B2
The inference engine 11 now works membership functions a21 and a22 in accordance with the previously found x1 and x2 and obtains first fuzzy grade numbers 0.75 (from a21(x1)) and 0.50 (from a22(x2)), from which second fuzzy grade number A2 is obtained by the following expression:
A21 and A22.ident.A2=0.75 and 0.50.ident.0.50
The inference engine 11 then works the above obtained value A2 on fuzzy output function B2 and performs the following operation:
A2.circle.B2
Since A2=0.50, the operation result is a reduction of the whole fuzzy output function B2 at a ratio of 0.50. This operation result is also illustrated in FIG. 13c (the triangle defined by dashed lines). Hereinafter, by repeating step 506 and steps 502 through 505 as mentioned above, the inference engine 11 reads the remaining rules R3 (on line three) to Rn (on line n) in order, performs processing similar to that of rules R1 and R2, and as a result, obtains "n" pieces of inference output comprising A1.circle.B1 to An.circle.Bn.
Then, at step 507, the inference engine 11 carries out a fuzzy composition process which composes all of the above implication operation result, i.e., calculates the center of gravity of the overlapped inference outputs, i.e., the figures in FIG. 13c enclosed by a bottom coordinate axis (y axis) and both vertical axes (grade coordinate axes). In the present example this is done for values of the above indicated A1.circle.B1 and A2.circle.B2, resulting in a y axis value (in %) as a defuzzy value. At step 508, the above defuzzy value is converted into an analog value by the D/A converter 13 and provided as output y.
By repeating the above steps at predetermined intervals, fuzzy control is carried out on the system 20 to be controlled.
In the above mentioned process, the membership functions a11 to a21, the fuzzy output functions B1 to Bn, and the rules R1 to Rn are all stored in the memory 14 by the setting/monitoring device 30 via the line controller 15. The values of the figures (the results of the implication operations A1.circle.B1 to An.circle.Bn) are also monitored, by specifying a whole or part thereof, by the setting/monitoring device 30 via the line controller 15. As is apparent from the flowchart shown in FIG. 14, since the prior art fuzzy controller 10 employs only one inference engine 11 to execute a succession of processes, in series, which are composed of the fuzzy grade number operations (step 502), the minimum value operation (step 503) and the implication operations (step 504), a comparatively long time is needed to perform the processes from input to output. In the first fuzzy grade number conversion by means of the membership function aij, therefore, a table reference system (i.e., a look-up table) is used to reduce the processing time, i.e., tabulated membership functions are stored in the memory 14 beforehand. As an example, if 10 types of 10 membership functions alj are input, each of 256-division accuracy, a memory capacity of: EQU 1 byte.times.256.times.10.times.10=25.6KB
is required and a large area is necessary for the table memory. Similarly, the fuzzy output functions B1 are also tabulated and stored in the memory 14 beforehand, and also require a large area for the table memory.
The fuzzy controller 10 of the prior art configured as described above has problems in that the fuzzy inference operation takes a relatively long time because it is executed in series by one inference engine 11, and in that since a table reference system must be used to reduce the processing time of the fuzzy grade number conversion by way of the membership functions, a comparatively large memory area is required. Moreover, since the fuzzy controller is designed as a dedicated controller, the wiring and connections become complicated in the monitoring of the fuzzy control results when employing a general-purpose controller, such as a programmable controller, resulting in extra cost and loss of time.